<template>
  <div class="app-container">
    <el-form ref="form" :model="data" label-width="80px">
      <el-form-item label="id">
        <div>{{data.id}}</div>
      </el-form-item>
      <el-form-item label="id">
        <div>{{data.roomId}}</div>
      </el-form-item>
      <el-form-item label="id">
        <div>{{data.dtuId}}</div>
      </el-form-item>
      <el-form-item label="控制器编码">
        <div>{{data.controlCode}}</div>
      </el-form-item>
      <el-form-item label="控制器名称">
        <div>{{data.controlName}}</div>
      </el-form-item>
      <el-form-item label="型号">
        <div>{{data.model}}</div>
      </el-form-item>
      <el-form-item label="type">
        <div>{{data.type}}</div>
      </el-form-item>
      <el-form-item label="时区">
        <div>{{data.timeZone}}</div>
      </el-form-item>
      <el-form-item label="冷库状态">
        <div>{{data.status|statusName()}}</div>
      </el-form-item>
      <el-form-item label="创建时间">
        <div>{{data.createTime}}</div>
      </el-form-item>
      <el-form-item label="更新时间">
        <div>{{data.updateTime}}</div>
      </el-form-item>
      <el-form-item label="foodType">
        <div>{{data.foodType}}</div>
      </el-form-item>

      <el-form-item label="foodSubtype">
        <div>{{data.foodSubtype}}</div>
      </el-form-item>

      <el-form-item label="停机温度">
        <div>{{data.shutdownTemp}}</div>
      </el-form-item>

      <el-form-item label="工作温度">
        <div>{{data.workingTemp}}</div>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import {storagedetail} from "../../api/article";
import {unitDetail} from "../../api/unit";

export default {
  name: "detail",
  data(){
    return{
      data:{}
    }
  },
  filters: {
    statusName(status) {
      if (status===1) {
        return '正常';
      }else{
        return '异常'
      }
    }
  },
  created() {
    this.getDetail(this.$route.query.id)
  },
  methods:{
    getDetail(id){
      unitDetail({id:id}).then(response => {
        this.data = response.data.data
      })
    }
  }

}
</script>

<style scoped>

</style>
